package com.sky.mapper;

import com.sky.entity.ShoppingCart;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ShoppingCartMapper {
    List<ShoppingCart> getListByUserIdAndSetmealId(ShoppingCart shoppingCart);

    void update(ShoppingCart shoppingCart);

    void add(ShoppingCart shoppingCart);

    @Select("select * from shopping_cart where user_id = #{currentId}")
    List<ShoppingCart> getListByUserId(Long currentId);

    @Delete("delete from shopping_cart where user_id = #{currentId}")
    void delAllByUserId(Long currentId);

    @Delete("delete from shopping_cart where id = #{id}")
    void delById(Long id);
}
